From 220c8fe6ff09e28b9e5f3c9847749f3c3f0e96d6 Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Wed, 10 Sep 2014 18:10:40 +0100 Subject: [PATCH] tools/[lib]xl: Correct use of init/dispose for libxl_domain_restore_params Signed-off-by: Andrew Cooper CC: Ian Campbell CC: Ian Jackson Acked-by: Ian Campbell --- tools/libxl/libxl.h | 9 +++++++-- tools/libxl/xl_cmdimpl.c | 6 ++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h index dab3a676bd..5136d028e7 100644 --- a/tools/libxl/libxl.h +++ b/tools/libxl/libxl.h @@ -847,10 +847,15 @@ int static inline libxl_domain_create_restore_0x040200( LIBXL_EXTERNAL_CALLERS_ONLY { libxl_domain_restore_params params; - params.checkpointed_stream = 0; + int ret; - return libxl_domain_create_restore( + libxl_domain_restore_params_init(¶ms); + + ret = libxl_domain_create_restore( ctx, d_config, domid, restore_fd, ¶ms, ao_how, aop_console_how); + + libxl_domain_restore_params_dispose(¶ms); + return ret; } #define libxl_domain_create_restore libxl_domain_create_restore_0x040200 diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 8a380773f8..26492fc7a5 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -2246,11 +2246,17 @@ start: if ( restoring ) { libxl_domain_restore_params params; + + libxl_domain_restore_params_init(¶ms); + params.checkpointed_stream = dom_info->checkpointed_stream; ret = libxl_domain_create_restore(ctx, &d_config, &domid, restore_fd, ¶ms, 0, autoconnect_console_how); + + libxl_domain_restore_params_dispose(¶ms); + /* * On subsequent reboot etc we should create the domain, not * restore/migrate-receive it again. -- 2.30.2